// 需要权限的路由
const files = import.meta.globEager('/src/permission/*.js')
const allRoutes = []
for (var key in files) {
	allRoutes.push(files[key].default)
}

let allHandleRoutes = []

const getSingleRoutes = function (routes) {
	for (let i = 0; i < routes.length; i++) {
		if (routes[i].children?.length > 0) {
			getSingleRoutes(routes[i].children)
		}
		delete routes[i].children
		allHandleRoutes.push(routes[i])
	}
}
getSingleRoutes(allRoutes)
// console.log(allRoutes, allHandleRoutes)

export default allHandleRoutes